package com.tchhy.provider.data.healthy.request

import android.os.Parcelable
import kotlinx.android.parcel.Parcelize

@Parcelize
data class LiveStreamingEntity(
    /**
     * 用户主键
     */
    val appUserId: Long?,
    /**
     * 直播封面图
     */
    var coverImage: String?,
    /**
     * 直播描述
     */
    var description: String?,
    /**
     * 直播结束时间
     */
    val endTime: String?,
    val isLive: Int = 0,
    /**
     * 1开播，2停播
     */
    val isOpen: Int = 1,
    /**
     * 是否预约
     */
    val isReserve: Boolean?,
    /**
     * 0不收费，1收费
     */
    val isToll: Int = 0,
    /**
     * 直播对应id
     */
    val liveId: Long?,
    val liveRoomId: Long?,
    val liveJson: String?,
    /**
     * 申请开播的时间
     */
    val liveTime: String?,
    /**
     * 观看价格, 保留两位小数时乘以100的值
     */
    var price: Long?,
    /**
     * 预约人数
     */
    var reserveNum: Int?,
    val startTime: String?,
    /**
     * 直播间状态，0默认状态，1同意，2拒绝
     */
    val status: Int = 0,
    var title: String?,
    /**
     * 直播类型
     */
    var type: String?,
    val userHeadImg: String?,
    val username: String?,
    val watchBaseNum: Int?,
    val watchNum: Int?,
    /**
     * 主播的健康好
     */
    val healthNumber: String?,
    /**
     * 算直播间在线人数的一个基础值，在这个值的基础上加上直播间真实的人数，则是显示的在线人数
     */
    val baseCount: Int?,
    /**
     * 标识是热播还是预播，为1是热播，0或者null是预播
     */
    val liveType: Int?,
    var groupIdImList: Array<String>?,
    val freeCount: Int?
) : Parcelable {

    override fun equals(other: Any?): Boolean {
        if (this === other) return true
        if (javaClass != other?.javaClass) return false

        other as LiveStreamingEntity

        if (appUserId != other.appUserId) return false
        if (coverImage != other.coverImage) return false
        if (description != other.description) return false
        if (endTime != other.endTime) return false
        if (isLive != other.isLive) return false
        if (isOpen != other.isOpen) return false
        if (isReserve != other.isReserve) return false
        if (isToll != other.isToll) return false
        if (liveId != other.liveId) return false
        if (liveRoomId != other.liveRoomId) return false
        if (liveJson != other.liveJson) return false
        if (liveTime != other.liveTime) return false
        if (price != other.price) return false
        if (reserveNum != other.reserveNum) return false
        if (startTime != other.startTime) return false
        if (status != other.status) return false
        if (title != other.title) return false
        if (type != other.type) return false
        if (userHeadImg != other.userHeadImg) return false
        if (username != other.username) return false
        if (watchBaseNum != other.watchBaseNum) return false
        if (watchNum != other.watchNum) return false
        if (healthNumber != other.healthNumber) return false
        if (baseCount != other.baseCount) return false
        if (liveType != other.liveType) return false
        if (groupIdImList != null) {
            if (other.groupIdImList == null) return false
            if (!groupIdImList.contentEquals(other.groupIdImList)) return false
        } else if (other.groupIdImList != null) return false
        if (freeCount != other.freeCount) return false

        return true
    }

    override fun hashCode(): Int {
        var result = appUserId?.hashCode() ?: 0
        result = 31 * result + (coverImage?.hashCode() ?: 0)
        result = 31 * result + (description?.hashCode() ?: 0)
        result = 31 * result + (endTime?.hashCode() ?: 0)
        result = 31 * result + isLive
        result = 31 * result + isOpen
        result = 31 * result + (isReserve?.hashCode() ?: 0)
        result = 31 * result + isToll
        result = 31 * result + (liveId?.hashCode() ?: 0)
        result = 31 * result + (liveRoomId?.hashCode() ?: 0)
        result = 31 * result + (liveJson?.hashCode() ?: 0)
        result = 31 * result + (liveTime?.hashCode() ?: 0)
        result = 31 * result + (price?.hashCode() ?: 0)
        result = 31 * result + (reserveNum ?: 0)
        result = 31 * result + (startTime?.hashCode() ?: 0)
        result = 31 * result + status
        result = 31 * result + (title?.hashCode() ?: 0)
        result = 31 * result + (type?.hashCode() ?: 0)
        result = 31 * result + (userHeadImg?.hashCode() ?: 0)
        result = 31 * result + (username?.hashCode() ?: 0)
        result = 31 * result + (watchBaseNum ?: 0)
        result = 31 * result + (watchNum ?: 0)
        result = 31 * result + (healthNumber?.hashCode() ?: 0)
        result = 31 * result + (baseCount ?: 0)
        result = 31 * result + (liveType ?: 0)
        result = 31 * result + (groupIdImList?.contentHashCode() ?: 0)
        result = 31 * result + (freeCount ?: 0)
        return result
    }
}